﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace System.Map
{
    public class BaiduGeo
    {
        public string Status { get; set; }
    }
    public class BaiduGeo<T> : BaiduGeo where T : new()
    {
        public BaiduGeo()
        {
            Result = new T();
        }
        public T Result { get; protected set; }
    }

    public class ReGeoResult
    {
        public Location Location { get; set; }
    }

    public class GeoResult
    {
        /// <summary>
        /// 坐标，通常为bd09ll 百度墨卡托坐标
        /// </summary>
        public Location Location { get; set; }
        public AddressComponent AddressComponent { get; set; }
    }
   

    public class AddressComponent
    {
        /// <summary>
        /// 省
        /// </summary>
        public string Province { get; set; }

        /// <summary>
        /// 市
        /// </summary>
        public string City { get; set; }

        /// <summary>
        /// 区
        /// </summary>
        public string District { get; set; }

        /// <summary>
        /// 街道
        /// </summary>
        public string Street { get; set; }

        /// <summary>
        /// 门牌号码
        /// </summary>
        [JsonProperty("Street_Number")]
        public string StreetNumber { get; set; }
        /// <summary>
        /// 详细地址:省市区县街道门牌号
        /// </summary>
        public string ToDetailAddress()
        {
            return string.Concat(Province, City, District, Street, StreetNumber);
        }
    }
}